<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	$debug = $_SESSION['debug'];
	
	/*
	* Class to validate a credential
	*/
	class CommandChangeAccount extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct ($pk_number, $type, $name, $description) {
			$this -> pk_number = $pk_number;
			$this -> type = $type;
			$this -> name = $name;
			$this -> description= $description;

		
		}
		
		/*
		* Method to execute to validate the credential
		*/
		public function execute() {
			$daoFactory= DaoFactory:: getMySqlDaoFactory();
			$iuad= $daoFactory-> getMySqlAccountAccessDao();			
			$success=$iuad->changeAccount($pk_number, $type, $name, $description);
	
			$this -> result = $success;
		}
	}
?>